package com.cyq.day05;

import java.util.Scanner;

public class ClassWork02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr1 = {10, 20, 30, 40, 50, 60};
        System.out.print("原数组为：");
        for (int b :
                arr1) {
            System.out.print(b + " ");
        }
        System.out.println();
        System.out.println("请选择想删除的元素是第几个（最大值为6）");
        int input = sc.nextInt();
        int[] arr2 = new int[arr1.length - 1];
        for (int i = 0; i < arr2.length; i++) {
            if (i < input - 1) {
                arr2[i] = arr1[i];
            } else {
                arr2[i] = arr1[i + 1];
            }
        }
        System.out.println("新数组为：");
        for (int a :
                arr2) {
            System.out.print(a + " ");
        }

    }
}
